package com.zlf.web_generator_code;

import org.mybatis.generator.api.ShellRunner;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * Created by Administrator on 2016/12/26.
 *
 * @author zlf
 */
public class MybatisGeneratorCode {

    public static void main(String[] args) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {
        Class clazz=ShellRunner.class;
        Method mainMethod=clazz.getMethod("main", String[].class);
        // Java -jar mybatis-generator-core-1.3.1.jar -configfile generatorConfig.xml -overwrite
        mainMethod.invoke(null,(Object)new String[]{"-configfile", "generator_code/src/main/resources/generatorConfig.xml","-overwrite"});
    }

}
